package com.blb.zycommunity.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.blb.zycommunity.entity.SysUser;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.security.core.GrantedAuthority;

import java.util.List;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 用户信息表 服务类
 * </p>
 *
 * @author chenheng
 * @since 2023-11-20
 */
public interface ISysUserService extends IService<SysUser> {
    IPage<SysUser> findUserPage(Long current, Long size, String deptName);

    /**
     * 根据用户名查询角色权限集合
     */
    List<GrantedAuthority> getAuthoritiesByUsername(String username);

    /**
     * 根据用户名查询用户信息
     * @param username
     * @return
     */
    SysUser getUserByUsername(String username);

    IPage<SysUser> findUserPage(Long current, Long size, String deptName, String status, String userName, String phonenumber, LocalDateTime startTime, LocalDateTime finishTime);

    List<SysUser> findPostByUserId(Long userId);

    List<SysUser> findRoleByUserId(Long userId);

    boolean updateUserStatus(String status, Long userId);

    List<SysUser> findUserSex();

    boolean updateUserPassword(String password, Long userId);

    boolean removeUser(Long userId);

    void batchDeleteUser(@Param("userIds") List<Long> userIds);

    SysUser excelUserById(Long userId);

    List<SysUser> findInformationByUsername(String username);


}


